package com.wn.date20190814;

import java.util.List;
import java.util.Iterator;
import java.util.LinkedList;

public class Test
{
	public static void main(String[] args)
	{
		List<String> list=new LinkedList<>();
		list.add("tq213");
		list.add("12tqwr");
		list.add("12qwr");
		list.add("tqwqwr");
		list.add("sdf");
		list.add("tqwr");
		list.add("qwrwr");
		List<String> deleteList=new LinkedList<String>();
		list.forEach(t->{if(t.toLowerCase().charAt(0)=='t') 
		{
			System.out.println(t);
			deleteList.add(t);
		}
		});
		
		// 迭代器实现
		//linked

		Iterator<String> iterator=list.iterator();
		while (iterator.hasNext())
		{
			String name=iterator.next();
			if(name.startsWith("t"))
				iterator.remove();
		}
		
//		list.removeAll(deleteList);
		System.out.println("=======");
		System.out.println(list);

	}
}
